package patern;

import patern.exceptions.IllegalActionForNodeException;
import engine.expression.Expression;
import engine.expression.Operators;

public class Node implements Patern
{
	private Patern left, right;
	private Operators operator;
	
	public Node(Operators operator, Patern left, Patern right)
	{
		this.operator = operator;
		this.left = left;
		this.right = right;
	}
	
	@Override
	public Patern left()
	{
		return left;
	}

	@Override
	public Patern right()
	{
		return right;
	}

	@Override
	public Operators operator()
	{
		return operator;
	}

	@Override
	public String name()
	{
		throw new IllegalActionForNodeException();
	}
	
	@Override
	public double value()
	{
		throw new IllegalActionForNodeException();
	}

	@Override
	public boolean isLeaf()
	{
		return false;
	}

	@Override
	public boolean match(Expression exp)
	{
		throw new IllegalActionForNodeException();
	}

}
